package heritage.single.table;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type_compte", discriminatorType = DiscriminatorType.STRING, length = 2)
public abstract class Compte implements Serializable {

	private static final long serialVersionUID = -1377695088779256634L;

	@Id
	protected String codeCompte;
	protected Date dateCreation;
	protected double solde;
	
	public Compte() {
	}

	public Compte(String codeCompte, Date dateCreation, double solde) {
		this.codeCompte = codeCompte;
		this.dateCreation = dateCreation;
		this.solde = solde;
	}

	public String getCodeCompte() {
		return codeCompte;
	}

	public Date getDateCreation() {
		return dateCreation;
	}

	public double getSolde() {
		return solde;
	}

	public void setCodeCompte(String codeCompte) {
		this.codeCompte = codeCompte;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	public void setSolde(double solde) {
		this.solde = solde;
	}
}
